//
//  UIBarButtonItem+LZExtension.m
//  百思不得姐
//
//  Created by 郝庆 on 16/5/21.
//  Copyright © 2016年 haoqing. All rights reserved.
//

#import "UIBarButtonItem+LZExtension.h"

@implementation UIBarButtonItem (LZExtension)
+ (instancetype)lz_itemWithImage:(NSString *)image highImage:(NSString *)highImage target:(id)target action:(SEL)action
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [button setImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted];
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [button sizeToFit];
    return [[self alloc] initWithCustomView:button];
}

@end
